package com.glasses.business.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.glasses.business.R;
import com.glasses.business.appliction.MyApplication;
import com.glasses.business.base.AppBaseFragment;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * Author：邓勇军
 * English Name：Deng,The Sky Fucker!
 * Email：dandycoder@126.com
 * Date：2017/3/10
 * Version：1.0
 */

public class OldFrameFragment extends AppBaseFragment {
    @InjectView(R.id.oldFrameAddr)
    TextView oldFrameAddr;
    @InjectView(R.id.oldFrameSure)
    TextView oldFrameSure;
    private String addressForChild;

    @Override
    public int getRootViewId() {
        return R.layout.fragment_old_frame;
    }

    @Override
    public void setViews() {
        setTitleTv("自备镜架");
    }

    @Override
    public void initData() {
        if (getArguments() != null) {
            addressForChild = getArguments().getString("addressForChild");
            oldFrameAddr.setText("        为保证佩戴舒适，请尽量选购光学镜架。如何选择合适镜架，请进入眼科资讯阅读相关文章。请确保镜架完好无损，并邮寄到:\n"+"        "+addressForChild+"。\n        自备镜架在加工过程中如发生损坏或不能安装等情况，加工部门将选择材质、形状、颜色相近的镜架进行加工，原镜架将寄回，不收取任何费用。");
        }
    }

    @Override
    public boolean mainTabShow() {
        return false;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.reset(this);
    }

    @OnClick(R.id.oldFrameSure)
    public void onClick() {
        MyApplication.getInstance().manager.onBackPressed();
    }
}
